package com.problem.leetcode;

import java.util.ArrayList;
import java.util.List;

/**
 * @author didi
 * @DESCRIPTION
 * @create 2019-05-20 19:50
 **/

public class Problem728 {
    public List<Integer> selfDividingNumbers(int left, int right) {

        List<Integer> lists = new ArrayList<>();

        for (int index = left; index <= right; index++) {
            boolean result = isMod(index);
            if (result) {
                lists.add(index);
            }
        }
        return lists;
    }

    private boolean isMod(int index) {
        int tmp = index;
        while (tmp != 0) {
            int mod = tmp % 10;
            if (mod == 0 || index % mod != 0) {
                return false;
            }
            tmp = tmp / 10;
        }
        return true;
    }

    public static void main(String[] args) {
        System.out.println(128 &1);
    }

}
